package com.yc.healthy.controller;


import com.yc.healthy.entity.Delicacies;
import com.yc.healthy.entity.Result;
import com.yc.healthy.mapper.DelicaciesMapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lyl
 * @since 2023-03-08
 */
@Controller
@RequestMapping("/healthy/delicacies")
public class DelicaciesController {

    @Resource
    DelicaciesMapper delicaciesMapper;

    @PostMapping("querycount")
    @ResponseBody
    public Result queryCount(){
        List<Delicacies> delicacies = delicaciesMapper.QueryCount();
        if (delicacies.isEmpty()){
            return new Result(0,"查无数据",null);
        }else {
            return new Result(1,"查询成功",delicacies);
        }
    }
}

